package com.jt.aop;


import com.jt.vo.SysResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice//通知!!!
//全局异常处理机制,只拦截Controller层
public class SystemException {
    @ExceptionHandler(RuntimeException.class) //指定异常的类型进行拦截
    public SysResult exception( Exception e ){
        e.printStackTrace();//控制台打印异常
        return SysResult.fail();//201
    }
}
